package com.heima.user.controller.v1;



import com.heima.common.dtos.ResponseResult;
import com.heima.model.behavior.dtos.ArticleUserInfoDto;
import com.heima.model.behavior.dtos.UserRelationDto;
import com.heima.user.service.ApFollowBehaviorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1")
public class ApFollewBehaviorController {

    @Autowired
    private ApFollowBehaviorService followBehaviorService;

    /**
     * 文章关注和取消
     * @param dto
     * @return
     */
    @PostMapping("/user/user_follow")
    public ResponseResult userFollew(@RequestBody UserRelationDto dto){
        return followBehaviorService.userFollew(dto);
    }

    /**
     * 查询用户是否关注文章
     * @param dto
     * @return
     */
    @PostMapping("/user_follow")
    public Boolean userIsFollew(@RequestBody ArticleUserInfoDto dto){
        return followBehaviorService.userIsFollew(dto);
    }
}
